﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LPV_POS.thuvien_cls
{
    class dongbo
    {
        string[] s;
        object[] o;
        #region " 0.DM_NHOMKHACHHANG"
        //---0.1-DM_NHOMKHACHHANG---INSERT
        public int f_DM_NHOMKHACHHANG_INSERT(string objid, string objname,string ma_may)
        {
            s = new string[] { "@flag", "@type", "@OBJID", "@OBJNAME", "@MA_MAY" };
            o = new object[] { 0,1,objid,objname,ma_may};
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        //---0.2-DM_NHOMKHACHHANG---DELETE
        public int f_DM_NHOMKHACHHANG_DELETE(string objid,string ma_may)
        {
            s = new string[] { "@flag", "@type", "@OBJID","@MA_MAY"};
            o = new object[] { 0, 2, objid ,ma_may};
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        //---0.3-DM_NHOMKHACHHANG---UPDATE
        public int f_DM_NHOMKHACHHANG_UPDATE(string objid, string objname,string ma_may)
        {
            s = new string[] { "@flag", "@type", "@OBJID", "@OBJNAME","@MA_MAY" };
            o = new object[] { 0, 3, objid, objname,ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        #endregion

        #region " 1.DM_KHACHHANG"
        //---1.1-DM_KHACHHANG---INSERT
        public int f_DM_KHACHHANG_INSERT(string objid,string objname,string ngaysinh,string manhomkhachhang,string diachi,string dienthoaiban,
            string dienthoaidd,string fax,string email,string nguoilienhe,string thekhachhang,string ma_so_thue,string cmnd_hochieu,string ma_may)
        {
            s = new string[] { "@flag", "@type","@OBJID","@OBJNAME","@NGAYSINH","@MANHOMKHACHHANG","@DIACHI","@DIENTHOAIBAN","@DIENTHOAIDD",
					"@FAX","@EMAIL","@NGUOILIENHE","@THEKHACHHANG","@MA_SO_THUE","@CMND_HOCHIEU","@MA_MAY" };
            o = new object[] { 1, 1, objid, objname,ngaysinh,manhomkhachhang,diachi,dienthoaiban,dienthoaidd,fax,email,nguoilienhe
            ,thekhachhang,ma_so_thue,cmnd_hochieu,ma_may};
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        //---1.2-DM_KHACHHANG---DELETE
        public int f_DM_KHACHHANG_DELETE(string objid,string ma_may)
        {
            s = new string[] { "@flag", "@type","@OBJID","@MA_MAY" };
            o = new object[] { 1, 2, objid,ma_may};
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        //---1.3-DM_KHACHHANG---UPDATE
        public int f_DM_KHACHHANG_UPDATE(string objid, string objname, string ngaysinh, string manhomkhachhang, string diachi, string dienthoaiban,
            string dienthoaidd, string fax, string email, string nguoilienhe, string thekhachhang, string ma_so_thue, string cmnd_hochieu,string ma_may)
        {
            s = new string[] { "@flag", "@type","@OBJID","@OBJNAME","@NGAYSINH","@MANHOMKHACHHANG","@DIACHI","@DIENTHOAIBAN","@DIENTHOAIDD",
					"@FAX","@EMAIL","@NGUOILIENHE","@THEKHACHHANG","@MA_SO_THUE","@CMND_HOCHIEU","@MA_MAY" };
            o = new object[] { 1, 3, objid, objname,ngaysinh,manhomkhachhang,diachi,dienthoaiban,dienthoaidd,fax,email,nguoilienhe
            ,thekhachhang,ma_so_thue,cmnd_hochieu,ma_may};
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        #endregion

        #region " 6. T_BH_PHIEU"
        //---6.1 BH_PHIEU - INSERT
        public int f_BH_PHIEU_INSERT(string objid, string makhohang, string customer_id, string dm_ban_ma, string nguoi_lap, string ca, string ngay_gio_vao
            , string ngay_gio_ra, string tinh_tien_theo_ngay, string tien_gio, string thanh_tien, string ck_thucan_phantram
            , string ck_thucan_tien, string ck_thucuong_phantram, string ck_thucuong_tien, string ck_phantram, string ck_tien, string km_phantram
            , string km_tien, string vat_phantram, string vat_tien, string ttiep_phantram
            , string ttiep_tien, string phu_thu_phantram, string phu_thu, string phu_thu_khac, string tong_tien, string ghi_chu, string ngay_lam_viec
            , string dm_khuyenmai_ma, string ti_gia_usd, string tinh_gia_usd, string ngaylapphieu, string tien_da_nhan
            , string tinh_tien_bang_the, string dm_ban_dat_ban_id, string so_khach, string nhanvien_phucvu,string ma_may)
        {
            s = new string[] {"@flag","@type","@OBJID","@MAKHOHANG","@CUSTOMER_ID","@DM_BAN_MA","@NGUOI_LAP","@CA","@NGAY_GIO_VAO","@NGAY_GIO_RA"
                ,"@TINH_TIEN_THEO_NGAY","@TIEN_GIO","@THANH_TIEN","@CK_THUCAN_PHANTRAM"
				,"@CK_THUCAN_TIEN","@CK_THUCUONG_PHANTRAM","@CK_THUCUONG_TIEN","@CK_PHANTRAM","@CK_TIEN"
                ,"@KM_PHANTRAM","@KM_TIEN","@VAT_PHANTRAM","@VAT_TIEN","@TTIEP_PHANTRAM"
				,"@TTIEP_TIEN","@PHU_THU_PHANTRAM","@PHU_THU","@PHU_THU_KHAC","@TONG_TIEN","@GHI_CHU"
                ,"@NGAY_LAM_VIEC","@DM_KHUYENMAI_MA","@TI_GIA_USD","@TINH_GIA_USD","@NGAYLAPPHIEU","@TIEN_DA_NHAN"
                ,"@TINH_TIEN_BANG_THE","@DM_BAN_DAT_BAN_ID","@SO_KHACH","@NHANVIEN_PHUCVU","@MA_MAY"};
            o = new object[] { 6, 1, objid,makhohang,customer_id,dm_ban_ma,nguoi_lap,ca,ngay_gio_vao,ngay_gio_ra,tinh_tien_theo_ngay,tien_gio,thanh_tien
                ,ck_thucan_phantram,ck_thucan_tien,ck_thucuong_phantram,ck_thucuong_tien,ck_phantram,ck_tien,km_phantram,km_tien,vat_phantram
                ,vat_tien,ttiep_phantram,ttiep_tien,phu_thu_phantram,phu_thu,phu_thu_khac,tong_tien,ghi_chu,ngay_lam_viec,dm_khuyenmai_ma,ti_gia_usd
                ,tinh_gia_usd,ngaylapphieu,tien_da_nhan,tinh_tien_bang_the,dm_ban_dat_ban_id,so_khach,nhanvien_phucvu,ma_may};
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        //---6.2 BH_PHIEU - DELETE
        public int f_BH_PHIEU_DELETE(string objid,string ma_may)
        {
            s = new string[] { "@flag", "@type", "@OBJID","@MA_MAY" };
            o = new object[] { 6, 2, objid,ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        //---6.3 BH_PHIEU - UPDATE
        public int f_BH_PHIEU_UPDATE(string objid, string makhohang, string customer_id, string dm_ban_ma, string nguoi_lap, string ca, string ngay_gio_vao
            , string ngay_gio_ra, string tinh_tien_theo_ngay, string tien_gio, string thanh_tien, string ck_thucan_phantram
            , string ck_thucan_tien, string ck_thucuong_phantram, string ck_thucuong_tien, string ck_phantram, string ck_tien, string km_phantram
            , string km_tien, string vat_phantram, string vat_tien, string ttiep_phantram
            , string ttiep_tien, string phu_thu_phantram, string phu_thu, string phu_thu_khac, string tong_tien, string ghi_chu, string ngay_lam_viec
            , string dm_khuyenmai_ma, string ti_gia_usd, string tinh_gia_usd, string ngaylapphieu, string tien_da_nhan
            , string tinh_tien_bang_the, string dm_ban_dat_ban_id, string so_khach, string nhanvien_phucvu,string ma_may)
        {
            s = new string[] {"@flag","@type","@OBJID","@MAKHOHANG","@CUSTOMER_ID","@DM_BAN_MA","@NGUOI_LAP","@CA","@NGAY_GIO_VAO","@NGAY_GIO_RA"
                ,"@TINH_TIEN_THEO_NGAY","@TIEN_GIO","@THANH_TIEN","@CK_THUCAN_PHANTRAM"
				,"@CK_THUCAN_TIEN","@CK_THUCUONG_PHANTRAM","@CK_THUCUONG_TIEN","@CK_PHANTRAM","@CK_TIEN"
                ,"@KM_PHANTRAM","@KM_TIEN","@VAT_PHANTRAM","@VAT_TIEN","@TTIEP_PHANTRAM"
				,"@TTIEP_TIEN","@PHU_THU_PHANTRAM","@PHU_THU","@PHU_THU_KHAC","@TONG_TIEN","@GHI_CHU"
                ,"@NGAY_LAM_VIEC","@DM_KHUYENMAI_MA","@TI_GIA_USD","@TINH_GIA_USD","@NGAYLAPPHIEU","@TIEN_DA_NHAN"
                ,"@TINH_TIEN_BANG_THE","@DM_BAN_DAT_BAN_ID","@SO_KHACH","@NHANVIEN_PHUCVU","@MA_MAY"};
            o = new object[] { 6, 3, objid,makhohang,customer_id,dm_ban_ma,nguoi_lap,ca,ngay_gio_vao,ngay_gio_ra,tinh_tien_theo_ngay,tien_gio,thanh_tien
                ,ck_thucan_phantram,ck_thucan_tien,ck_thucuong_phantram,ck_thucuong_tien,ck_phantram,ck_tien,km_phantram,km_tien,vat_phantram
                ,vat_tien,ttiep_phantram,ttiep_tien,phu_thu_phantram,phu_thu,phu_thu_khac,tong_tien,ghi_chu,ngay_lam_viec,dm_khuyenmai_ma,ti_gia_usd
                ,tinh_gia_usd,ngaylapphieu,tien_da_nhan,tinh_tien_bang_the,dm_ban_dat_ban_id,so_khach,nhanvien_phucvu,ma_may};
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        #endregion

        #region " 2. T_BH_PHIEU_CT
        //---2.1 BH_PHIEU_CT - INSERT
        public int f_BH_PHIEU_CT_INSERT(string objid, string bh_phieu_ma, string mahh, string so_luong, 
            string dvt, string don_gia, string thanh_tien_truoc, string chietkhau_phantram, 
            string chietkhau_tien, string km_phantram, string km_tien, string vat_phantram,
            string vat_tien, string thanh_tien, string ghi_chu, string ngay_tinh_gio, string tinh_gia_usd, string gia_von,string ma_may)
        {
            s = new string[] {"@flag","@type","@OBJID","@BH_PHIEU_MA","@MAHH","@SO_LUONG","@DVT","@DON_GIA","@THANH_TIEN_TRUOC","@CHIETKHAU_PHANTRAM",
          "@CHIETKHAU_TIEN","@KM_PHANTRAM","@KM_TIEN","@VAT_PHANTRAM","@VAT_TIEN","@THANH_TIEN","@GHI_CHU","@NGAY_TINH_GIO","@TINH_GIA_USD","@GIA_VON","@MA_MAY"};
            o = new object[] { 2, 1, objid, bh_phieu_ma, mahh, so_luong, dvt, don_gia, thanh_tien_truoc, chietkhau_phantram,
                chietkhau_tien, km_phantram, km_tien, vat_phantram, vat_tien, thanh_tien, ghi_chu, ngay_tinh_gio, tinh_gia_usd, gia_von,ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        //---2.2 BH_PHIEU_CT - DELETE
        public int f_BH_PHIEU_CT_DELETE(string objid,string ma_may)
        {
            s = new string[] {"@flag","@type","@OBJID","@MA_MAY"};
            o = new object[] { 2, 2, objid,ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        //---2.3 BH_PHIEU_CT - UPDATE
        public int f_BH_PHIEU_CT_UPDATE(string objid, string bh_phieu_ma, string mahh, string so_luong,
            string dvt, string don_gia, string thanh_tien_truoc, string chietkhau_phantram,
            string chietkhau_tien, string km_phantram, string km_tien, string vat_phantram,
            string vat_tien, string thanh_tien, string ghi_chu, string ngay_tinh_gio, string tinh_gia_usd, string gia_von,string ma_may)
        {
            s = new string[] {"@flag","@type","@OBJID","@BH_PHIEU_MA","@MAHH","@SO_LUONG","@DVT","@DON_GIA","@THANH_TIEN_TRUOC","@CHIETKHAU_PHANTRAM",
          "@CHIETKHAU_TIEN","@KM_PHANTRAM","@KM_TIEN","@VAT_PHANTRAM","@VAT_TIEN","@THANH_TIEN","@GHI_CHU","@NGAY_TINH_GIO","@TINH_GIA_USD","@GIA_VON","@MA_MAY"};
            o = new object[] { 2, 3, objid, bh_phieu_ma, mahh, so_luong, dvt, don_gia, thanh_tien_truoc, chietkhau_phantram,
                chietkhau_tien, km_phantram, km_tien, vat_phantram, vat_tien, thanh_tien, ghi_chu, ngay_tinh_gio, tinh_gia_usd, gia_von,ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        #endregion

        #region " 3 BH_PHIEU_DOIDIEM_THANHMON"
        //---3.1 BH_PHIEU_DOIDIEM_THANHMON - INSERT
        public int f_BH_PHIEU_DOIDIEM_THANHMON_INSERT(string objid,string dm_the_code,string ngay,string diem,string ghi_chu,string ma_may)
        {
            s = new string[] {"@flag","@type","@OBJID","@DM_THE_CODE","@NGAY","@DIEM","@GHI_CHU","@MA_MAY"};
            o = new object[] { 3, 1, objid, dm_the_code, ngay, diem, ghi_chu,ma_may };
                                int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        //---3.2 BH_PHIEU_DOIDIEM_THANHMON - DELETE
        public int f_BH_PHIEU_DOIDIEM_THANHMON_DELETE(string objid,string ma_may)
        {
            s = new string[] {"@flag","@type","@OBJID","@MA_MAY"};
            o = new object[] { 3, 2, objid,ma_may};
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        #endregion

        #region " 4 BH_PHIEU_DOIDIEM_TRUDIEM"
        //---4.1 BH_PHIEU_DOIDIEM_TRUDIEM - INSERT
        public int f_BH_PHIEU_DOIDIEM_TRUDIEM_INSERT(string objid, string dm_the_code, string ngay, string diem, string ghi_chu, string ma_may)
        {
            s = new string[] {"@flag","@type","@OBJID","@DM_THE_CODE","@NGAY","@DIEM","@GHI_CHU","@MA_MAY"};
            o = new object[] { 4, 1,objid, dm_the_code, ngay, diem, ghi_chu,ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        //---4.2 BH_PHIEU_DOIDIEM_TRUDIEM - DELETE
        public int f_BH_PHIEU_DOIDIEM_TRUDIEM_DELETE(string objid, string ma_may)
        {
            s = new string[] {"@flag","@type","@OBJID","@MA_MAY"};
            o = new object[] { 4, 2, objid,ma_may};
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        #endregion

        #region " 5. BH_PHIEU_LUU_DIEM "
        //---5.1 BH_PHIEU_LUU_DIEM - INSERT
        public int f_BH_PHIEU_LUU_DIEM_INSERT(string bh_phieu_ma, string dm_the_code, string diem, string ngay, string ma_may)
        {
            s = new string[] { "@flag", "@type", "@OBJID", "@DM_THE_CODE", "@DIEM", "@NGAY", "@MA_MAY" };
            o = new object[] { 5, 1,bh_phieu_ma, dm_the_code, diem, ngay,ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        //---5.2 BH_PHIEU_LUU_DIEM - DELETE
        public int f_BH_PHIEU_LUU_DIEM_DELETE(string bh_phieu_ma, string ma_may)
        {
            s = new string[] { "@flag", "@type", "@OBJID","@MA_MAY" };
            o = new object[] { 5, 2, bh_phieu_ma, ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        //---5.3 BH_PHIEU_LUU_DIEM - UPDATE
        public int f_BH_PHIEU_LUU_DIEM_UPDATE(string bh_phieu_ma, string dm_the_code, string diem, string ngay, string ma_may)
        {
            s = new string[] { "@flag", "@type", "@OBJID", "@DM_THE_CODE", "@DIEM", "@NGAY", "@MA_MAY" };
            o = new object[] { 5, 3, bh_phieu_ma, dm_the_code, diem, ngay, ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        #endregion

        #region " 9. DM_CONGNO "
        //---9.1 DM_CONGNO - INSERT
        public int f_DM_CONGNO_INSERT(string objid, string ma_khachhang, string so_phieu, string ngay, string dien_giai, string no_ban_dau, string thieu_no, string tra_no, string con_lai, string ma_may)
        {
            s = new string[] { "@flag", "@type", "@OBJID", "@MA_KHACHHANG", "@SO_PHIEU", "@NGAY", "@DIEN_GIAI", "@NO_BAN_DAU", "@THIEU_NO", "@TRA_NO", "@CON_LAI", "@MA_MAY" };
            o = new object[] { 9, 1, objid, ma_khachhang, so_phieu, ngay, dien_giai, no_ban_dau, thieu_no, tra_no, con_lai, ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        //---9.2 DM_CONGNO - DELETE
        public int f_DM_CONGNO_DELETE(string objid,string so_phieu, string ma_may)
        {
            s = new string[] { "@flag", "@type", "@OBJID","@SO_PHIEU", "@MA_MAY" };
            o = new object[] { 9, 2, objid,so_phieu, ma_may};
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        //---9.3 DM_CONGNO - UPDATE
        public int f_DM_CONGNO_UPDATE(string objid, string ma_khachhang, string so_phieu, string ngay, string dien_giai, string no_ban_dau, string thieu_no, string tra_no, string con_lai, string ma_may)
        {
            s = new string[] { "@flag", "@type", "@OBJID", "@MA_KHACHHANG", "@SO_PHIEU", "@NGAY", "@DIEN_GIAI", "@NO_BAN_DAU", "@THIEU_NO", "@TRA_NO", "@CON_LAI", "@MA_MAY" };
            o = new object[] { 9, 3, objid, ma_khachhang, so_phieu, ngay, dien_giai, no_ban_dau, thieu_no, tra_no, con_lai, ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        #endregion

        #region " 10. DM_CONGNOPHAITHU_BANDAU "
        //---10.1 DM_CONGNOPHAITHU_BANDAU - INSERT
        public int f_DM_CONGNOPHAITHU_BANDAU_INSERT(string ma, string makhachhang, string sotien, string ghichu, string ma_may)
        {
            s = new string[] { "@flag", "@type", "@MA", "@MAKHACHHANG", "@SOTIEN", "@GHICHU", "@MA_MAY" };
            o = new object[] { 10, 1, ma, makhachhang, sotien, ghichu, ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        //---10.2 DM_CONGNOPHAITHU_BANDAU - DELETE
        public int f_DM_CONGNOPHAITHU_BANDAU_DELETE(string ma, string ma_may)
        {
            s = new string[] { "@flag", "@type", "@MA", "@MA_MAY" };
            o = new object[] { 10, 2, ma, ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        //---10.3 DM_CONGNOPHAITHU_BANDAU - UPDATE
        public int f_DM_CONGNOPHAITHU_BANDAU_UPDATE(string ma, string makhachhang, string sotien, string ghichu, string ma_may)
        {
            s = new string[] { "@flag", "@type", "@MA", "@MAKHACHHANG", "@SOTIEN", "@GHICHU", "@MA_MAY" };
            o = new object[] { 10, 3, ma, makhachhang, sotien, ghichu, ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        #endregion

        #region " 11. PHIEU_THU "
        //---11.1 PHIEU_THU - INSERT
        public int f_PHIEU_THU_INSERT(string docid,string soct,string ngayct,string manv,string nguoicapnhat,string ngaycapnhat,string nguoiduyet,string ngayduyet
            , string makhachhang, string malydothu, string matt, string tygia, string tongtien, string trangthai, string ghichu, string ma_may)
        {
            
            s = new string[] {"@flag","@type","@DOCID","@SOCT","@NGAYCT","@MANV","@NGUOICAPNHAT","@NGAYCAPNHAT","@NGUOIDUYET",
         "@NGAYDUYET","@MAKHACHHANG","@MALYDOTHU","@MATT","@TYGIA","@TONGTIEN","@TRANGTHAI","@GHICHU","@MA_MAY" };
            o = new object[] { 11, 1, docid, soct, ngayct, manv, nguoicapnhat, ngaycapnhat, nguoiduyet, ngayduyet
                , makhachhang, malydothu, matt, tygia, tongtien, trangthai, ghichu,ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        //---11.2 PHIEU_THU - DELETE
        public int f_PHIEU_THU_DELETE(string docid, string ma_may)
        {
            s = new string[] { "@flag", "@type", "@DOCID", "@MA_MAY" };
            o = new object[] { 11, 2, docid, ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        //---11.3 PHIEU_THU - UPDATE
        public int f_PHIEU_THU_UPDATE(string docid, string soct, string ngayct, string manv, string nguoicapnhat, string ngaycapnhat, string nguoiduyet, string ngayduyet
            , string makhachhang, string malydothu, string matt, string tygia, string tongtien, string trangthai, string ghichu, string ma_may)
        {
            s = new string[] {"@flag","@type","@DOCID","@SOCT","@NGAYCT","@MANV","@NGUOICAPNHAT","@NGAYCAPNHAT","@NGUOIDUYET",
         "@NGAYDUYET","@MAKHACHHANG","@MALYDOTHU","@MATT","@TYGIA","@TONGTIEN","@TRANGTHAI","@GHICHU","@MA_MAY" };
            o = new object[] { 11, 3, docid, soct, ngayct, manv, nguoicapnhat, ngaycapnhat, nguoiduyet, ngayduyet
                , makhachhang, malydothu, matt, tygia, tongtien, trangthai, ghichu,ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        #endregion

        #region " 12. DM_KHUYENMAI "
        //---12.1 DM_KHUYENMAI - INSERT
        public int f_DM_KHUYENMAI_INSERT(string objid,string objname,string hinhthuc_km,string makhohang
            ,string tungay,string denngay,string thu_2,string thu_3,string thu_4,string thu_5,string thu_6
            , string thu_7, string chunhat, string tugio, string dengio, string thamso_1, string thamso_2, string ma_may)
        {
            s = new string[] {"@flag","@type","@OBJID","@OBJNAME","@HINHTHUC_KM","@MAKHOHANG","@TUNGAY","@DENNGAY","@THU_2","@THU_3"
				 ,"@THU_4","@THU_5","@THU_6","@THU_7","@CHUNHAT","@TUGIO","@DENGIO","@THAMSO_1","@THAMSO_2","@MA_MAY" };
            o = new object[] { 12, 1, objid, objname, hinhthuc_km, makhohang, tungay, denngay, thu_2, thu_3, thu_4
                , thu_5, thu_6, thu_7, chunhat, tugio, dengio, thamso_1, thamso_2 ,ma_may};
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        //---12.2 DM_KHUYENMAI - DELETE
        public int f_DM_KHUYENMAI_DELETE(string objid, string ma_may)
        {
            s = new string[] { "@flag", "@type", "@OBJID", "@MA_MAY" };
            o = new object[] { 12, 2, objid, ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        //---12.3 DM_KHUYENMAI - UPDATE
        public int f_DM_KHUYENMAI_UPDATE(string objid, string objname, string hinhthuc_km, string makhohang
            , string tungay, string denngay, string thu_2, string thu_3, string thu_4, string thu_5, string thu_6
            , string thu_7, string chunhat, string tugio, string dengio, string thamso_1, string thamso_2, string ma_may)
        {
            s = new string[] {"@flag","@type","@OBJID","@OBJNAME","@HINHTHUC_KM","@MAKHOHANG","@TUNGAY","@DENNGAY","@THU_2","@THU_3"
				 ,"@THU_4","@THU_5","@THU_6","@THU_7","@CHUNHAT","@TUGIO","@DENGIO","@THAMSO_1","@THAMSO_2","@MA_MAY" };
            o = new object[] { 12, 3, objid, objname, hinhthuc_km, makhohang, tungay, denngay, thu_2, thu_3, thu_4
                , thu_5, thu_6, thu_7, chunhat, tugio, dengio, thamso_1, thamso_2,ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        #endregion

        #region " 13. DM_KHUYENMAI_CT "
        //---13.1 DM_KHUYENMAI_CT - INSERT
        public int f_DM_KHUYENMAI_CT_INSERT(string objid, string makm, string mahhban, string mahhtang
            , string maquatang, string ma_may)
        {
            s = new string[] { "@flag", "@type", "@OBJID", "@MAKM", "@MAHHBAN", @"MAHHTANG", "@MAQUATANG", "@MA_MAY" };
            o = new object[] { 13, 1, objid, makm, mahhban, mahhtang, maquatang, ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        //---13.2 DM_KHUYENMAI_CT - DELETE
        public int f_DM_KHUYENMAI_CT_DELETE(string objid, string ma_may)
        {
            s = new string[] { "@flag", "@type", "@OBJID", "@MA_MAY" };
            o = new object[] { 13, 2, objid, ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        //---13.3 DM_KHUYENMAI_CT - UPDATE
        public int f_DM_KHUYENMAI_CT_UPDATE(string objid, string makm, string mahhban, string mahhtang
            , string maquatang, string ma_may)
        {
            s = new string[] { "@flag", "@type", "@OBJID", "@MAKM", "@MAHHBAN", @"MAHHTANG", "@MAQUATANG", "@MA_MAY" };
            o = new object[] { 13, 3, objid, makm, mahhban, mahhtang, maquatang, ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        #endregion

        #region " 14. DM_KHUYENMAI_DIEM "
        //---14.3 DM_KHUYENMAI_DIEM - UPDATE
        public int f_DM_KHUYENMAI_DIEM_UPDATE(string objname, string diem, string tong_tien, string ma_may)
        {
            s = new string[] { "@flag", "@type", "@OBJNAME", "@DIEM", "@TONG_TIEN", "@MA_MAY" };
            o = new object[] { 14, 3, objname, diem, tong_tien, ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        #endregion

        #region " 15. DM_KHUYENMAI_QUATANG "
        //---15.1 DM_KHUYENMAI_QUATANG - INSERT
        public int f_DM_KHUYENMAI_QUATANG_INSERT(string maquatang, string tenquatang, string dvt, string ma_may)
        {
            s = new string[] { "@flag", "@type", "@MAQUATANG", "@TENQUATANG", "@DVT", "@MA_MAY" };
            o = new object[] { 15, 1, maquatang, tenquatang, dvt, ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        //---15.2 DM_KHUYENMAI_QUATANG - DELETE
        public int f_DM_KHUYENMAI_QUATANG_DELETE(string maquatang, string ma_may)
        {
            s = new string[] { "@flag", "@type", "@MAQUATANG", "@MA_MAY" };
            o = new object[] { 15, 2, maquatang, ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        //---15.3 DM_KHUYENMAI_QUATANG - UPDATE
        public int f_DM_KHUYENMAI_QUATANG_UPDATE(string maquatang, string tenquatang, string dvt, string ma_may)
        {
            s = new string[] { "@flag", "@type", "@MAQUATANG", "@TENQUATANG", "@DVT", "@MA_MAY" };
            o = new object[] { 15, 3, maquatang, tenquatang, dvt, ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        #endregion

        #region " 16. DM_KHUYENMAI_THE "
        //---16.1 DM_KHUYENMAI_THE - INSERT
        public int f_DM_KHUYENMAI_THE_INSERT(string objid, string makhuyenmai, string mathe, string dm_nhomkhachhang_ma, string ma_may)
        {
            s = new string[] { "@flag", "@type", "@OBJID", "@MAKHUYENMAI", "@MATHE", "@DM_NHOMKHACHHANG_MA", "@MA_MAY" };
            o = new object[] { 16, 1, objid, makhuyenmai, mathe, dm_nhomkhachhang_ma, ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        //---16.2 DM_KHUYENMAI_THE - DELETE
        public int f_DM_KHUYENMAI_THE_DELETE(string objid, string ma_may)
        {
            s = new string[] { "@flag", "@type", "@OBJID", "@MA_MAY" };
            o = new object[] { 16, 2, objid, ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        //---16.3 DM_KHUYENMAI_THE - UPDATE
        public int f_DM_KHUYENMAI_THE_UPDATE(string objid, string makhuyenmai, string mathe, string dm_nhomkhachhang_ma, string ma_may)
        {
            s = new string[] { "@flag", "@type", "@OBJID", "@MAKHUYENMAI", "@MATHE", "@DM_NHOMKHACHHANG_MA", "@MA_MAY" };
            o = new object[] { 16, 3, objid, makhuyenmai, mathe, dm_nhomkhachhang_ma, ma_may };
            int ketqua = new thuvien_SV().SP_Update("T_sp_DONG_BO_SV", s, o);
            return ketqua;
        }
        #endregion
    }
}
